package com.lxh.lxhcrm.model.dao.preSale;

import com.lxh.lxhcrm.model.pojos.Opportunity;
import com.lxh.lxhcrm.model.vo.OppotunityVo;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface OppoDao extends CrudRepository<Opportunity, Integer> {
    /**
     * 单纯的查询所有机会
     * @author 罗晓
     * @return List<Opportunity>
     */
    @Query("select new com.lxh.lxhcrm.model.vo.OppotunityVo(o.oppoId,o.oppoName) from Opportunity o where o.oppoName = ?1")
    List<OppotunityVo> findByOppoName(String oppoName);
}
